<%@ page import="com.wuming.house.security.SecurityHander" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/3/20
  Time: 18:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>管理动态</title>
    <link rel="stylesheet" href="${allServerPath}static/layui/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${allServerPath}static/layui/css/public.css" media="all"/>
</head>
<body style="background-color: #f0f2f5;" class="childrenBody">
<div class="layui-fluid wuli-main">
    <div class="layui-row">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>编辑动态</legend>
        </fieldset>
        <form class="layui-form">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">标题</label>

                    <div class="layui-input-inline">
                        <input type="text" id="infoTitle" name="infoTitle" autocomplete="off"
                               class="layui-input" value="${info['infoTitle']}">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">


                <div class="layui-inline">
                    <label class="layui-form-label">作者</label>

                    <div class="layui-input-inline">
                        <input type="text" id="author" name="author" autocomplete="off"
                               class="layui-input" value="${info['author']}">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">内容</label>

                    <div class="layui-input-inline">
                        <textarea type="text" id="infoContent" name="infoContent" autocomplete="off" class="layui-input" value="${info['infoContent']}" style="height: 150px"></textarea>
                    </div>
                </div>
            </div>
            <input type="hidden" name="id" value="${layout['id']}">
        </form>
        <div class="layui-row wuli-button">
            <button class="layui-btn layui-btn-normal" name="btnSave">保存</button>
        </div>
    </div>
</div>
<script type="text/javascript" src="${allServerPath}static/layui/layui/layui.js"></script>
<script src="${allServerPath}static/js/jquery-2.1.4.min.js"></script>
<script>
    layui.use(['layer', 'form', 'jquery', 'upload'], function () {
        var form = layui.form
            , layer = layui.layer
            , $ = layui.$;

        var id = $("input[name='id']").val();

        $("button[name='btnSave']").on('click', function () {
            $.ajax({
                type: "post",
                data: {
                    id: id,
                    houseId: '${houseId}',
                    infoTitle: $("#infoTitle").val(),
                    infoContent: $("#infoContent").val(),
                    author: $("#author").val()
                },
                url: '${allServerPath}web/houseinfo/save.htmls',
                success: function (obj) {
                    if (obj.success) {
                        layer.msg("保存成功");
                    }
                }
            });
        });
    });


    <%--function setBannerImg() {--%>
    <%--$.ajax({--%>
    <%--type: "post",--%>
    <%--data: {--%>
    <%--id: '${banner.picId}',--%>
    <%--},--%>
    <%--url: '${allServerPath}web/goodsCate/getGoodImage.htmls?t=<%=System.currentTimeMillis()%>',--%>
    <%--success: function (obj) {--%>
    <%--if (obj.success) {--%>
    <%--$("#uploadImage").attr("src", obj.data);--%>
    <%--}--%>
    <%--}--%>
    <%--});--%>
    <%--}--%>
</script>
</body>
</html>
